package com.khyr.controller;



import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.khyr.entity.CheckItem;

import com.khyr.service.CheckItemService1;
import com.khyr.vo.CheckItemVo;
import com.khyr.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 宋一恒
 * @version 1.0
 */
@RestController
@RequestMapping(value ="/systemManager/checkItem")
public class checkItemController {
    @Autowired
    private CheckItemService1 checkItemService;
    //查询
    @PostMapping(value ="/findCheckItemByCond")
    public R<Page<CheckItem>> findCheckItemByCond(@RequestBody CheckItemVo checkItemVo) {
        return checkItemService.findCheckItemByCond(checkItemVo);
    }
    //添加
    @PostMapping(value ="/addCheckItem")
    public R<String> addCheckItem(@RequestBody CheckItem checkItem) {
        return checkItemService.addCheckItem(checkItem);
    }

    //修改
    @PostMapping(value ="/updateCheckItem")
    public R<String> updateCheckItem(@RequestBody CheckItem checkItem) {
        return checkItemService.updateCheckItem(checkItem);
    }

    //查询一个
    @PostMapping(value ="/getCheckItemByCheckItemId/{id}")
    public R<CheckItem> getCheckItemByCheckItemId(@PathVariable Long id) {
        return checkItemService.getCheckItemByCheckItemId(id);
    }

    //删除
    @PostMapping(value ="/deleteCheckItemByIds/{ids}")
    public R<String> deleteCheckItemByIds(@PathVariable List<Long> ids) {
        return checkItemService.deleteCheckItemByIds(ids);
    }
}
